package com.df.controller;

import com.df.bean.Product;
import com.df.client.ProductClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;

/**
 * @program: codes
 * @description:
 * @author: df
 * @create: 2023-07-10 13:27:54
 **/
@RestController
public class CategoryController {

    @Value("${server.port}")
    private int port;

    @Autowired
    private ProductClient productClient;

    @GetMapping("/category")
    public String category(){
        //String result = productClient.product();
        // queryString 传参
        //String result = productClient.test(1,"df");
        // 路径传参
        //String result = productClient.test1(1,"df");
        //String result = productClient.product(new Product(1,"df"));
        String result = productClient.array(new Integer[]{1,2,3});
        return "hello ok:"+result;
    }

    @GetMapping("/get")
    public Product get(){
        Product product = productClient.get(1);
        return product;
    }
}
